# coding = utf-8
from time import sleep
from selenium import webdriver
# 驱动文件路径
from selenium.webdriver.common.by import By

if __name__ == '__main__':
    driverfile_path = r'C:\Program Files\Google\Chrome\Application\chromedriver.exe'
    # 启动浏览器
    driver = webdriver.Chrome(driverfile_path)
    # 打开百度首页
    driver.get(r'https://www.baidu.com/')
    # 等待网页加载完毕
    driver.implicitly_wait(15)
    driver.find_element(By.CSS_SELECTOR, "#kw").send_keys("selenium")
    sleep(10)
    # 退出
    driver.quit()
